<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Read the news you are subscribed to</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
	</head>
	
	<body>
	<div id="wrapper">
	
		<%@ include file="headerNews.jsp" %>
		
		<%@ include file="menuNews.jsp" %>
		
		<div id="page">
		<div id="page-bgtop">
		<div id="page-bgbtm">
		
		<div id="content">
	
		<div>
			<h1 class="mainText">These are your messages</h1>
		</div>

		<div>
			<c:forEach var="msg" items="${msgIDShowMap}">
			
				<div class="post">
				<div class="post-bgtop">
				<div class="post-bgbtm">
			
					<h2 class="title">${msgIDHeaderMap[msg.key]}</h2>
					
					<form action="read" method="get">
						<div>
							<input type="hidden" name="msgID" value="${msg.key}" />
               				<input type="submit" class="button" name="deleteMsg" value="Delete" />
			
							<c:choose>
								<c:when test="${msg.value}">
               						<input type="submit" class="button" name="hideMsg" value="Hide" />
								</c:when>
								<c:otherwise>
               						<input type="submit" class="button" name="readMsg" value="Read" />
								</c:otherwise>
							</c:choose>
						</div>
					</form>
					
					<c:if test="${msg.value}">
						<div class="entry">
							${msgIDTextMap[msg.key]}
						</div>
					</c:if>
   			
    			</div>
    			</div>
    			</div>
    			
			</c:forEach>
		</div>
		
		<div style="clear: both;">&nbsp;</div>
		
		</div>
		
		<%@ include file="sidebarNews.jsp" %>
		<div style="clear: both;">&nbsp;</div>
		
		</div>
		</div>
		</div>
		
		<%@ include file="footerNews.jsp" %>

	</div>
	</body>
</html>